import React, { Component } from 'react';

//预约体检首页

class App extends Component {
  jump(url){
    this.props.history.push(url)
  }
  componentWillMount(){
     //console.log(window.location.hash)
     var url=window.location.hash
      var theRequest = new Object(); 
   if (url.indexOf("?") != -1) {   
      var str = url.substr(3); 
       var strs = str.split("&");   
      for(var i = 0; i < strs.length; i ++) {   
         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
      }   
   }   
  localStorage.setItem('openId',theRequest.openId)
  localStorage.setItem('salesId',theRequest.salesId)
  localStorage.setItem('co',theRequest.co)
  }
  render() {
    return (
      <div>
     <header className="mui-bar mui-bar-nav">
      <h1 className="mui-title">体检预约</h1>
     </header>
       <div className="mui-content">
        <div className="index-list">
          <ul>
            <li onClick={()=>this.jump('/dregister')}  >
               <div className="mui-pull-left">
                   <p className="big-size">预约体检</p>
                     <p className="small-size">Appointment medical examination</p>
                 </div>
                 <div className="mui-pull-right index-ico index-ico-img1"></div>
            </li>
             <li onClick={()=>this.jump('/record')}>
               <div className="mui-pull-left">
                   <p className="big-size">预约记录</p>
                     <p className="small-size">Appointment record</p>
                 </div>
                 <div className="mui-pull-right index-ico index-ico-img2"></div>
             </li>
             <li onClick={()=>this.jump('/drecord')}>
               <div className="mui-pull-left">
                   <p className="big-size">待预约体检</p>
                     <p className="small-size">To be scheduled medical examination</p>
                 </div>
                 <div className="mui-pull-right index-ico index-ico-img3"></div>
             </li>
             <li>
               <div className="mui-pull-left">
                   <p className="big-size">预约指引</p>
                     <p className="small-size">Appointment guide</p>
                 </div>
                 <div className="mui-pull-right index-ico index-ico-img4"></div>
             </li>

          </ul>
        </div>
    </div>
      

    </div>
    );
  }
}

export default App;
